#include <bits/stdc++.h>

using namespace std;

//https://leetcode-cn.com/contest/weekly-contest-207/
/**
 将字符串中的空格分配均匀
 */ 

class Solution {
public:
    string getspace(int x){
        string a="";
        for(int i=0;i<x;i++){
            a+=" ";
        }
        return a;
    }
    string reorderSpaces(string text) {
        int spacenum=0,len=text.length(),letternum=0;
        vector<string> v;
        for(int i=0;i<len;i++){
            if(text[i]==' ') spacenum++;
            if(i-1>=0&&isalpha(text[i-1])&&' '==text[i]){
                letternum++;
            }
        }
        if(text[len-1]!=' ') letternum++;
        if(spacenum==0) return text;
        vector<int> l;
        vector<int> r;
        int in=0;
        while(in<len){
            if(in==0 && isalpha(text[in])){
                l.push_back(in-1);
            }
            if(in==len-1 && isalpha(text[in]))
                r.push_back(in+1);

           if(in+1<len && text[in]==' '&& isalpha(text[in+1]) ){  
                l.push_back(in);
           }

           if(in-1>= 0 && text[in]==' '&& isalpha(text[in-1]) ){
                r.push_back(in);
           }
           
           in++;
        }

        for(int i=0;i<l.size();i++){
            v.push_back(text.substr(l[i]+1,r[i]-l[i]-1));
        }
        int ts=0,te=0;
        if(letternum>1){
            ts=spacenum/(letternum-1);
            te=spacenum%(letternum-1);
        }else if(1==letternum) {
             ts=0;
             te=spacenum;
        }
        
        cout << spacenum<< " " << letternum << " "<< ts << " " << te <<endl;
        string ans="";
        for(int i=0;i<v.size();i++){
            ans+=v[i];
            if(i!=v.size()-1)
                ans+=getspace(ts);    
        }
        ans+=getspace(te);


        return ans;
    }
};

int main(){
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
    Solution s;
    string t;
    while(getline(cin,t)){
        cout << s.reorderSpaces(t) <<endl;
    }


    return 0;
}